<!DOCTYPE html PUBLIC "-//W3C//Dtd XHTML 1.0 Transitional//EN" "http://www.w3.org/tr/xhtml1/Dtd/xhtml1-transitional.dtd">
<html lang="zh_CN" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta http-equiv="x-ua-compatible" content="IE=edge, chrome=1">
    <title>j5shop商城</title>
    <meta name="description" content="" />
    <meta name="keywords" content="" />
    <link href="/street/css/public.css" type="text/css" rel="stylesheet"/>
    <script type="text/javascript" src="/street/js/jquery-1.7.2.min.js"></script>
    <script type="text/javascript" src="/street/js/slide.js"></script>
</head>
<script>
    $(function(){
        $('.nav ul li').hover(function(){
            $(this).children(".details").show();
        },function(){
            $(this).children(".details").hide();
        });
        $('#my').hover(function(){
            $(this).find("div").show();
        },function(){
            $(this).find("div").hide();
        });
    });
</script>
<body>
<div th:replace="street/layout/mallHeader"></div>

<!-----------------内容------------------>
<div class="wt1080 middle">
    <div class="fl">
        <div style="padding: 0 24px;"><h1>用户名称</h1></div>
        <ul>
            <li><a onclick="bna1('me',this)">账户安全</a></li>
            <li><a th:href="@{'/person/street/order'}">我的订单</a></li>
            <li><a onclick="bna1('coupon',this)" href="#">我的优惠卷</a></li>
            <li><a onclick="bna1('jfgoods',this)" href="#">我的积分商品</a></li>
            <li><a onclick="bna1('collect',this)" href="#">我收藏的商品</a></li>
            <li><a onclick="bna1('address',this)" href="#">管理收货地址</a></li>
        </ul>
    </div>
    <div class="fr" id="listAll">



    </div>
    <div class="clear"></div>
</div>

<!---------------------热销------------------>
<div class="hot wt1080">
    <div class="title">热销推荐</div>
    <div class="content">
        <ul>
            <li th:each="com:${commList}">
                <div class="pic"><a th:href="@{'/street/goodsDetail/'+${com.id}}">
                    <img th:src="@{${com.img}}"></a></div>
                <p class="c_t"><a th:href="@{'/street/goodsDetail/'+${com.id}}" th:text="${com.title}">Regen10片</a></p>
                <p class="price" th:text="'￥'+${com.prices}">￥89.00</p>
                <a href="#" class="goumai" th:onclick="'addCart('+${com.id}+')'">立即购买</a>
            </li>
        </ul>
        <div class="clear"></div>
    </div>
</div>
<script>
    bna1('me');
    //精品、最新、全部课程
    function bna1(type,obj) {
        var _timer = null;
        $(obj).addClass('banner_hover').siblings().removeClass('banner_hover');
        $.ajax({
            url :"/person/street/ajax-my",
            data : {
                "status" : type
            },
            type : 'post',
            dataType : 'text',
            beforeSend:function(){
                clearTimeout(_timer);

            },
            success : function(result) {
                _timer = setTimeout(function(){
                    $("#listAll").html(result);
                }, 300);
            }
        });
    }
    function addCart(goodsid){
        var count=1;
        $.ajax({
            type: "post",
            url: '/person/street/addCart',
            data: {
                goodsid:goodsid,
                count:count},
            dataType: "json",
            success:function(data) {
                if(data.code==0){
                    window.location.href = "/person/street/likBuy/"+goodsid;
                }else if(data.success=='login'){
                    window.location.href = "/street/login"
                }
            }
        });
    }
</script>
<div th:replace="street/layout/mallFooter"></div>
</body>
</html>
